package smartgrid.modules.trade;

import java.util.List;

public class Offer {
	
	public enum Status {
		ACTIVE,
		INACTIVE
	};
	
	// Offer status
	private Status				status;
	
	// Prosumer identification
	private int						prosumerId;
	
	// Quantity to offer
	private double				quantity;
	
	// Offer price per unit
	private double				price;
	
	// List of ostracized prosumers
	private List<Integer>	excluded;
	
	
	/**
	 * Offer constructor
	 * 
	 * @param none
	 * @return none
	 */
	public Offer() {
		this.status = Status.INACTIVE;
	}
	
	
	/**
	 * Offer constructor
	 * 
	 * @param prosumerId
	 *          Prosumer identification
	 * @param quantity
	 *          Quantity of energy
	 * @param price
	 *          Price per unit of energy
	 * @param excluded
	 *          Ostracized Prosumers
	 * @return none
	 */
	public Offer(int prosumerId, double quantity, double price,
			List<Integer> excluded) {
		this.status = Status.ACTIVE;
		this.prosumerId = prosumerId;
		this.quantity = quantity;
		this.price = price;
		this.excluded = excluded;
	}
	
	
	/**
	 * Get offer status
	 * 
	 * @param none
	 * @return Offer status
	 */
	public Status getStatus() {
		return this.status;
	}
	
	
	/**
	 * Get Prosumer identification
	 * 
	 * @param none
	 * @return Prosumer identification
	 */
	public int getProsumer() {
		return this.prosumerId;
	}
	
	
	/**
	 * Get quantity of energy to offer
	 * 
	 * @param none
	 * @return Quantity of energy
	 */
	public double getQuantity() {
		return this.quantity;
	}
	
	
	/**
	 * Get price per energy unit
	 * 
	 * @param none
	 * @return Price per energy unity
	 */
	public double getPrice() {
		return this.price;
	}
	
	
	/**
	 * Get list of ostracized Prosumers
	 * 
	 * @param none
	 * @return List of ostracized Prosumers
	 */
	public List<Integer> getExluded() {
		return this.excluded;
	}
	
	
	@Override
	public String toString() {
		String str = new String();
		
		str += "[OFFER] " + this.status + " " + this.prosumerId + " "
				+ this.quantity + " " + this.price + " " + this.excluded;
		
		return str;
	}
}